// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2025-02-15',
  devtools: { enabled: true },
  css: [
    '@/assets/styles/tailwind.css',
    '@/assets/main.css',
    '@/assets/styles/index.scss',
    '@/assets/styles/variables.scss',
    'element-plus/dist/index.css' // 引入 Element Plus 的样式
  ],
  modules: [
    '@nuxtjs/tailwindcss',
    '@pinia/nuxt'
  ],
  pinia: {
    autoImports: [
      'defineStore', // import { defineStore } from 'pinia'
    ],
  },
  plugins: [
    '~/plugins/element-plus.js', // 注册 Element Plus 插件
    '~/plugins/axios.js', // 注册 Axios 插件
    '~/plugins/auth.js', // 注册 Token 获取插件
  ],
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },
  nitro: {
    devProxy: {
      '/api': {
        target: 'https://api.indtrd.com', // 这里是接口地址
        changeOrigin: true,
        prependPath: true,
      },
    },
    routeRules: {
      '/api/**': {
        proxy: 'https://api.indtrd.com',
      },
    },
  },
  build: {
    transpile: ['lodash-es']
  }
})